3.4.76 \(\int (b \cos (c+d x))^n (A+B \cos (c+d x)+C \cos ^2(c+d x)) \sec ^4(c+d x) \, dx\) [376]

3.4.76.1 Optimal result
3.4.76.2 Mathematica [A] (verified)
3.4.76.3 Rubi [A] (verified)
3.4.76.4 Maple [F]
3.4.76.5 Fricas [F]
3.4.76.6 Sympy [F(-1)]
3.4.76.7 Maxima [F]
3.4.76.8 Giac [F]
3.4.76.9 Mupad [F(-1)]

3.4.76.1 Optimal result

Integrand size = 39, antiderivative size = 196 \[ \int (b \cos (c+d x))^n \left (A+B \cos (c+d x)+C \cos ^2(c+d x)\right ) \sec ^4(c+d x) \, dx=-\frac {b^3 C (b \cos (c+d x))^{-3+n} \sin (c+d x)}{d (2-n)}+\frac {b^3 (A (2-n)+C (3-n)) (b \cos (c+d x))^{-3+n} \operatorname {Hypergeometric2F1}\left (\frac {1}{2},\frac {1}{2} (-3+n),\frac {1}{2} (-1+n),\cos ^2(c+d x)\right ) \sin (c+d x)}{d (2-n) (3-n) \sqrt {\sin ^2(c+d x)}}+\frac {b^2 B (b \cos (c+d x))^{-2+n} \operatorname {Hypergeometric2F1}\left (\frac {1}{2},\frac {1}{2} (-2+n),\frac {n}{2},\cos ^2(c+d x)\right ) \sin (c+d x)}{d (2-n) \sqrt {\sin ^2(c+d x)}} \]

output
-b^3*C*(b*cos(d*x+c))^(-3+n)*sin(d*x+c)/d/(2-n)+b^3*(A*(2-n)+C*(3-n))*(b*c 
os(d*x+c))^(-3+n)*hypergeom([1/2, -3/2+1/2*n],[-1/2+1/2*n],cos(d*x+c)^2)*s 
in(d*x+c)/d/(n^2-5*n+6)/(sin(d*x+c)^2)^(1/2)+b^2*B*(b*cos(d*x+c))^(-2+n)*h 
ypergeom([1/2, -1+1/2*n],[1/2*n],cos(d*x+c)^2)*sin(d*x+c)/d/(2-n)/(sin(d*x 
+c)^2)^(1/2)
 
3.4.76.2 Mathematica [A] (verified)

Time = 0.24 (sec) , antiderivative size = 150, normalized size of antiderivative = 0.77 \[ \int (b \cos (c+d x))^n \left (A+B \cos (c+d x)+C \cos ^2(c+d x)\right ) \sec ^4(c+d x) \, dx=\frac {(b \cos (c+d x))^n \csc (c+d x) \sec ^3(c+d x) \left (-\left ((C (-3+n)+A (-2+n)) \operatorname {Hypergeometric2F1}\left (\frac {1}{2},\frac {1}{2} (-3+n),\frac {1}{2} (-1+n),\cos ^2(c+d x)\right ) \sqrt {\sin ^2(c+d x)}\right )+(-3+n) \left (C \sin ^2(c+d x)-B \cos (c+d x) \operatorname {Hypergeometric2F1}\left (\frac {1}{2},\frac {1}{2} (-2+n),\frac {n}{2},\cos ^2(c+d x)\right ) \sqrt {\sin ^2(c+d x)}\right )\right )}{d (-3+n) (-2+n)} \]

input
Integrate[(b*Cos[c + d*x])^n*(A + B*Cos[c + d*x] + C*Cos[c + d*x]^2)*Sec[c 
 + d*x]^4,x]
 
output
((b*Cos[c + d*x])^n*Csc[c + d*x]*Sec[c + d*x]^3*(-((C*(-3 + n) + A*(-2 + n 
))*Hypergeometric2F1[1/2, (-3 + n)/2, (-1 + n)/2, Cos[c + d*x]^2]*Sqrt[Sin 
[c + d*x]^2]) + (-3 + n)*(C*Sin[c + d*x]^2 - B*Cos[c + d*x]*Hypergeometric 
2F1[1/2, (-2 + n)/2, n/2, Cos[c + d*x]^2]*Sqrt[Sin[c + d*x]^2])))/(d*(-3 + 
 n)*(-2 + n))
 
3.4.76.3 Rubi [A] (verified)

Time = 0.66 (sec) , antiderivative size = 195, normalized size of antiderivative = 0.99, number of steps used = 8, number of rules used = 8, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.205, Rules used = {3042, 2030, 3502, 25, 3042, 3227, 3042, 3122}

Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.

\(\displaystyle \int \sec ^4(c+d x) (b \cos (c+d x))^n \left (A+B \cos (c+d x)+C \cos ^2(c+d x)\right ) \, dx\)

\(\Big \downarrow \) 3042

\(\displaystyle \int \frac {\left (b \sin \left (c+d x+\frac {\pi }{2}\right )\right )^n \left (A+B \sin \left (c+d x+\frac {\pi }{2}\right )+C \sin \left (c+d x+\frac {\pi }{2}\right )^2\right )}{\sin \left (c+d x+\frac {\pi }{2}\right )^4}dx\)

\(\Big \downarrow \) 2030

\(\displaystyle b^4 \int \left (b \sin \left (\frac {1}{2} (2 c+\pi )+d x\right )\right )^{n-4} \left (C \sin \left (\frac {1}{2} (2 c+\pi )+d x\right )^2+B \sin \left (\frac {1}{2} (2 c+\pi )+d x\right )+A\right )dx\)

\(\Big \downarrow \) 3502

\(\displaystyle b^4 \left (-\frac {\int -(b \cos (c+d x))^{n-4} (b (A (2-n)+C (3-n))+b B (2-n) \cos (c+d x))dx}{b (2-n)}-\frac {C \sin (c+d x) (b \cos (c+d x))^{n-3}}{b d (2-n)}\right )\)

\(\Big \downarrow \) 25

\(\displaystyle b^4 \left (\frac {\int (b \cos (c+d x))^{n-4} (b (A (2-n)+C (3-n))+b B (2-n) \cos (c+d x))dx}{b (2-n)}-\frac {C \sin (c+d x) (b \cos (c+d x))^{n-3}}{b d (2-n)}\right )\)

\(\Big \downarrow \) 3042

\(\displaystyle b^4 \left (\frac {\int \left (b \sin \left (c+d x+\frac {\pi }{2}\right )\right )^{n-4} \left (b (A (2-n)+C (3-n))+b B (2-n) \sin \left (c+d x+\frac {\pi }{2}\right )\right )dx}{b (2-n)}-\frac {C \sin (c+d x) (b \cos (c+d x))^{n-3}}{b d (2-n)}\right )\)

\(\Big \downarrow \) 3227

\(\displaystyle b^4 \left (\frac {b (A (2-n)+C (3-n)) \int (b \cos (c+d x))^{n-4}dx+B (2-n) \int (b \cos (c+d x))^{n-3}dx}{b (2-n)}-\frac {C \sin (c+d x) (b \cos (c+d x))^{n-3}}{b d (2-n)}\right )\)

\(\Big \downarrow \) 3042

\(\displaystyle b^4 \left (\frac {b (A (2-n)+C (3-n)) \int \left (b \sin \left (c+d x+\frac {\pi }{2}\right )\right )^{n-4}dx+B (2-n) \int \left (b \sin \left (c+d x+\frac {\pi }{2}\right )\right )^{n-3}dx}{b (2-n)}-\frac {C \sin (c+d x) (b \cos (c+d x))^{n-3}}{b d (2-n)}\right )\)

\(\Big \downarrow \) 3122

\(\displaystyle b^4 \left (\frac {\frac {(A (2-n)+C (3-n)) \sin (c+d x) (b \cos (c+d x))^{n-3} \operatorname {Hypergeometric2F1}\left (\frac {1}{2},\frac {n-3}{2},\frac {n-1}{2},\cos ^2(c+d x)\right )}{d (3-n) \sqrt {\sin ^2(c+d x)}}+\frac {B \sin (c+d x) (b \cos (c+d x))^{n-2} \operatorname {Hypergeometric2F1}\left (\frac {1}{2},\frac {n-2}{2},\frac {n}{2},\cos ^2(c+d x)\right )}{b d \sqrt {\sin ^2(c+d x)}}}{b (2-n)}-\frac {C \sin (c+d x) (b \cos (c+d x))^{n-3}}{b d (2-n)}\right )\)

input
Int[(b*Cos[c + d*x])^n*(A + B*Cos[c + d*x] + C*Cos[c + d*x]^2)*Sec[c + d*x 
]^4,x]
 
output
b^4*(-((C*(b*Cos[c + d*x])^(-3 + n)*Sin[c + d*x])/(b*d*(2 - n))) + (((A*(2 
 - n) + C*(3 - n))*(b*Cos[c + d*x])^(-3 + n)*Hypergeometric2F1[1/2, (-3 + 
n)/2, (-1 + n)/2, Cos[c + d*x]^2]*Sin[c + d*x])/(d*(3 - n)*Sqrt[Sin[c + d* 
x]^2]) + (B*(b*Cos[c + d*x])^(-2 + n)*Hypergeometric2F1[1/2, (-2 + n)/2, n 
/2, Cos[c + d*x]^2]*Sin[c + d*x])/(b*d*Sqrt[Sin[c + d*x]^2]))/(b*(2 - n)))
 

3.4.76.3.1 Defintions of rubi rules used

rule 25
Int[-(Fx_), x_Symbol] :> Simp[Identity[-1]   Int[Fx, x], x]
 

rule 2030
Int[(Fx_.)*(v_)^(m_.)*((b_)*(v_))^(n_), x_Symbol] :> Simp[1/b^m   Int[(b*v) 
^(m + n)*Fx, x], x] /; FreeQ[{b, n}, x] && IntegerQ[m]
 

rule 3042
Int[u_, x_Symbol] :> Int[DeactivateTrig[u, x], x] /; FunctionOfTrigOfLinear 
Q[u, x]
 

rule 3122
Int[((b_.)*sin[(c_.) + (d_.)*(x_)])^(n_), x_Symbol] :> Simp[Cos[c + d*x]*(( 
b*Sin[c + d*x])^(n + 1)/(b*d*(n + 1)*Sqrt[Cos[c + d*x]^2]))*Hypergeometric2 
F1[1/2, (n + 1)/2, (n + 3)/2, Sin[c + d*x]^2], x] /; FreeQ[{b, c, d, n}, x] 
 &&  !IntegerQ[2*n]
 

rule 3227
Int[((b_.)*sin[(e_.) + (f_.)*(x_)])^(m_)*((c_) + (d_.)*sin[(e_.) + (f_.)*(x 
_)]), x_Symbol] :> Simp[c   Int[(b*Sin[e + f*x])^m, x], x] + Simp[d/b   Int 
[(b*Sin[e + f*x])^(m + 1), x], x] /; FreeQ[{b, c, d, e, f, m}, x]
 

rule 3502
Int[((a_.) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_.)*((A_.) + (B_.)*sin[(e_.) 
+ (f_.)*(x_)] + (C_.)*sin[(e_.) + (f_.)*(x_)]^2), x_Symbol] :> Simp[(-C)*Co 
s[e + f*x]*((a + b*Sin[e + f*x])^(m + 1)/(b*f*(m + 2))), x] + Simp[1/(b*(m 
+ 2))   Int[(a + b*Sin[e + f*x])^m*Simp[A*b*(m + 2) + b*C*(m + 1) + (b*B*(m 
 + 2) - a*C)*Sin[e + f*x], x], x], x] /; FreeQ[{a, b, e, f, A, B, C, m}, x] 
 &&  !LtQ[m, -1]
 
3.4.76.4 Maple [F]

\[\int \left (\cos \left (d x +c \right ) b \right )^{n} \left (A +B \cos \left (d x +c \right )+C \left (\cos ^{2}\left (d x +c \right )\right )\right ) \left (\sec ^{4}\left (d x +c \right )\right )d x\]

input
int((cos(d*x+c)*b)^n*(A+B*cos(d*x+c)+C*cos(d*x+c)^2)*sec(d*x+c)^4,x)
 
output
int((cos(d*x+c)*b)^n*(A+B*cos(d*x+c)+C*cos(d*x+c)^2)*sec(d*x+c)^4,x)
 
3.4.76.5 Fricas [F]

\[ \int (b \cos (c+d x))^n \left (A+B \cos (c+d x)+C \cos ^2(c+d x)\right ) \sec ^4(c+d x) \, dx=\int { {\left (C \cos \left (d x + c\right )^{2} + B \cos \left (d x + c\right ) + A\right )} \left (b \cos \left (d x + c\right )\right )^{n} \sec \left (d x + c\right )^{4} \,d x } \]

input
integrate((b*cos(d*x+c))^n*(A+B*cos(d*x+c)+C*cos(d*x+c)^2)*sec(d*x+c)^4,x, 
 algorithm="fricas")
 
output
integral((C*cos(d*x + c)^2 + B*cos(d*x + c) + A)*(b*cos(d*x + c))^n*sec(d* 
x + c)^4, x)
 
3.4.76.6 Sympy [F(-1)]

Timed out. \[ \int (b \cos (c+d x))^n \left (A+B \cos (c+d x)+C \cos ^2(c+d x)\right ) \sec ^4(c+d x) \, dx=\text {Timed out} \]

input
integrate((b*cos(d*x+c))**n*(A+B*cos(d*x+c)+C*cos(d*x+c)**2)*sec(d*x+c)**4 
,x)
 
output
Timed out
 
3.4.76.7 Maxima [F]

\[ \int (b \cos (c+d x))^n \left (A+B \cos (c+d x)+C \cos ^2(c+d x)\right ) \sec ^4(c+d x) \, dx=\int { {\left (C \cos \left (d x + c\right )^{2} + B \cos \left (d x + c\right ) + A\right )} \left (b \cos \left (d x + c\right )\right )^{n} \sec \left (d x + c\right )^{4} \,d x } \]

input
integrate((b*cos(d*x+c))^n*(A+B*cos(d*x+c)+C*cos(d*x+c)^2)*sec(d*x+c)^4,x, 
 algorithm="maxima")
 
output
integrate((C*cos(d*x + c)^2 + B*cos(d*x + c) + A)*(b*cos(d*x + c))^n*sec(d 
*x + c)^4, x)
 
3.4.76.8 Giac [F]

\[ \int (b \cos (c+d x))^n \left (A+B \cos (c+d x)+C \cos ^2(c+d x)\right ) \sec ^4(c+d x) \, dx=\int { {\left (C \cos \left (d x + c\right )^{2} + B \cos \left (d x + c\right ) + A\right )} \left (b \cos \left (d x + c\right )\right )^{n} \sec \left (d x + c\right )^{4} \,d x } \]

input
integrate((b*cos(d*x+c))^n*(A+B*cos(d*x+c)+C*cos(d*x+c)^2)*sec(d*x+c)^4,x, 
 algorithm="giac")
 
output
integrate((C*cos(d*x + c)^2 + B*cos(d*x + c) + A)*(b*cos(d*x + c))^n*sec(d 
*x + c)^4, x)
 
3.4.76.9 Mupad [F(-1)]

Timed out. \[ \int (b \cos (c+d x))^n \left (A+B \cos (c+d x)+C \cos ^2(c+d x)\right ) \sec ^4(c+d x) \, dx=\int \frac {{\left (b\,\cos \left (c+d\,x\right )\right )}^n\,\left (C\,{\cos \left (c+d\,x\right )}^2+B\,\cos \left (c+d\,x\right )+A\right )}{{\cos \left (c+d\,x\right )}^4} \,d x \]

input
int(((b*cos(c + d*x))^n*(A + B*cos(c + d*x) + C*cos(c + d*x)^2))/cos(c + d 
*x)^4,x)
 
output
int(((b*cos(c + d*x))^n*(A + B*cos(c + d*x) + C*cos(c + d*x)^2))/cos(c + d 
*x)^4, x)